/*
 * Compressed by JSA(www.xidea.org)
 */
var P = {
    _cFlyme: function() {
        var A = $("#flyme"),
        _ = $.trim(A.val()),
        B = false;
        if (!_) Valiate.sError("flyme", "\u6b64\u5904\u4e0d\u80fd\u4e3a\u7a7a", 1, {
            "y": 3
        });
        else {
            Valiate.hError("flyme", 1);
            B = true
        }
        return B
    },
    _cPwd: function() {
        var B = false,
        A = $("#pwd"),
        _ = (A.val() + "");
        if (!_) Valiate.sError("pwd", "\u6b64\u5904\u4e0d\u80fd\u4e3a\u7a7a", 1, {
            "y": 3
        });
        else {
            Valiate.hError("pwd", 1);
            B = true
        }
        return B
    },
    _cVcode: function() {
        var C = false,
        B = $("#kapkey"),
        A = B.parent(),
        _ = B.val();
        if (B.length && !_) {
            Valiate.sError("imgKey", "\u6b64\u5904\u4e0d\u80fd\u4e3a\u7a7a", false, {
                "x": -12,
                "y": 5
            });
            A.addClass("errorCls")
        } else {
            if (B.length) {
                Valiate.hError("imgKey");
                A.removeClass("errorCls")
            }
            C = true
        }
        return C
    },
    _subing: false,
    check: function() {
        var A = P._cFlyme(),
        B = P._cPwd(),
        C = P._cVcode(),
        _ = A && B && C;
        if (_) {
            $("#uname").val($("#flyme").val());
            $("#action").val("login");
            $("#loginform").submit()
        }
    }
};
$(function() {
    var _ = $("#error").val();
    if (_) {
        if (_ == "3") jAlert("\u7cfb\u7edf\u68c0\u6d4b\u5230\u60a8\u7684\u8d26\u6237\u5bc6\u7801\u8fc7\u4e8e\u7b80\u5355\uff0c\u5b58\u5728\u88ab\u76d7\u7528\u7684\u98ce\u9669\u3002\u4e3a\u4e86\u60a8\u7684\u8d26\u6237\u5b89\u5168\uff0c\u8bf7\u60a8\u52a0\u5f3a\u5bc6\u7801\u8bbe\u7f6e\u3002", "\u63d0\u793a",
        function() {
            window.location.href = url
        });
        else if (_ == "11") {
            Valiate.sError("flyme", "\u8be5\u8d26\u6237\u5c1a\u672a\u6ce8\u518c", 1, {
                "y": 3
            });
            $("#flyme").focus().select()
        } else if (_ == "14") {
            $("#pwd").val("");
            $("#pwd").focus();
            Valiate.sError("pwd", "\u5bc6\u7801\u9519\u8bef", 1, {
                "y": 3
            })
        } else if (_ == "13") {
            $("#pwd").val("");
            $("#totalerror").html("\u5bc6\u7801\u9519\u8bef\u8d85\u8fc7" + window["errorTime"] + "\u6b21\uff0c\u8bf7" + window["errorHour"] + "\u4e2a\u5c0f\u65f6\u540e\u91cd\u8bd5").show()
        } else if (_ == "4") {
            $("#kapkey").parent().addClass("errorCls");
            Valiate.sError("imgKey", "\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef", false, {
                "x": -12,
                "y": 5
            })
        } else if (_) $("#totalerror").html(_).show()
    } else $("#validateImg").val("");
    if (!window["isM8"]) {
        $.eventInput([{
            "id": "flyme",
            "loc": 1
        },
        {
            "id": "pwd",
            "loc": 1
        }]);
        $("#remember").mzCheckBox()
    }
    if ($("#flyme").val() == "") $("#flyme").focus();
    $("#flyme").focus(function() {
        $("#totalerror").hide()
    }).blur(P._cFlyme);
    $("#pwd").focus(function() {
        $("#totalerror").hide()
    }).blur(P._cPwd);
    $("#kapkey").focus(function() {
        $("#totalerror").hide()
    }).blur(P._cVcode);
    $("#login").click(P.check);
    $("#loginform").bind("keypress",
    function($) {
        if ($.keyCode == 13) P.check()
    });
    $("#nextAutoLogin").bind("keypress",
    function(_) {
        if (_.keyCode == 32 || _.charCode == 32) $(this).click()
    });
    if ($("#imgKey").length) $("#imgKey").bind("click",
    function() {
        $("#imgKey")[0].src = $("#imgKey")[0].src + "?t=" + (new Date()).getTime()
    }).get(0).src = "kaptcha.jpg?t=" + (new Date()).getTime()
})